package com.hmy.cornpestdet.service;

import com.hmy.cornpestdet.mapper.AdminRiceDistributionMapper;
import com.hmy.cornpestdet.utils.Result;
import com.hmy.cornpestdet.vo.ProvinceDiseaseRateVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminRiceDistributionService {
    @Autowired
    AdminRiceDistributionMapper adminRiceDistributionMapper;

    public Result getAllDiseaseRate(){
        List<ProvinceDiseaseRateVo> list = adminRiceDistributionMapper.getAllDiseaseRate();
        if(list == null){
            return Result.Error("查询失败");
        }
        return Result.Success("查询成功",list);
    }

    public Result getDiseaseRateByName(String name){
        List<ProvinceDiseaseRateVo> list = adminRiceDistributionMapper.getDiseaseRateByName(name);
        if(list == null){
            return Result.Error("查询失败");
        }
        return Result.Success("查询成功",list);
    }

}
